package com.ad.pet.ui;

import android.app.Dialog;
import android.content.Context;
import android.view.Gravity;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;

import com.ad.pet.R;

/**
 * Created by SEELE on 2019/5/14.
 */

public class SkuDialog extends Dialog {


    public SkuDialog(Context context, int themeResId) {
        super(context, themeResId);

    }
    @Override
    public void show() {
        super.show();
        /**
         * 设置宽度全屏，要设置在show的后面
         */
        WindowManager.LayoutParams layoutParams = getWindow().getAttributes();
        layoutParams.gravity= Gravity.BOTTOM;
        layoutParams.width= ViewGroup.LayoutParams.MATCH_PARENT;
        layoutParams.height= ViewGroup.LayoutParams.WRAP_CONTENT;
        Window win = getWindow();
        win.setWindowAnimations(R.style.dialogWindowAnim);

        getWindow().getDecorView().setPadding(0, 0, 0, 0);

        getWindow().setAttributes(layoutParams);

    }

}
